package com.wisdudu.blank.support.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * Created by qyf on 2016/5/6.
 * 用于图片浏览内photoview异常崩溃情况处理
 */
public class ExceptionViewPager extends ViewPager {
    public ExceptionViewPager(Context context) {
        super(context);
    }

    public ExceptionViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        try {
            return super.onInterceptTouchEvent(ev);
        } catch (IllegalArgumentException e) {
            //uncomment if you really want to see these errors
//            e.printStackTrace();
            return false;
        }
    }
}
